<#compress>
    <#assign actionname>${(action=='create')?string('开通','编辑')}</#assign>
    <@override name="title">会员</@override>
    <@override name="viewcss">

    <link rel="stylesheet" type="text/css" href="${ctx}/static/scripts/plugins/bootstrap-datepicker/css/datepicker.css"/>
    </@override>
    <@override name="viewbody">
    <div class="row">
        <div class="col-md-12">

            <h3 class="page-title">
                会员管理
                <small>${actionname}会员</small>
            </h3>
            <ul class="page-breadcrumb breadcrumb">

                <li>
                    <i class="fa fa-home"></i>
                    <a href="${ctx}/customer/index">首页</a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="${ctx}/customer/member">会员管理</a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="#">${actionname}会员</a>
                </li>
            </ul>

        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="portlet">
                <div class="portlet-title">
                    <div class="caption">
                        <i class="fa fa-users"></i> 会员信息
                    </div>
                </div>
                <div class="portlet-body form">
                    <form action="${ctx}/customer/member/save" id="member_form" method="post" class="form-horizontal" role="form">
                        <input type="hidden" name="member.id" id="id" value="${member.id!}"/>

                        <div class="form-body">

                            <div class="form-group">
                                <label class="col-md-3 control-label" for="name">姓名 <span class="required">*</span></label>

                                <div class="col-md-9">
                                    <div class="input-icon right">
                                        <i class="fa"></i>
                                        <input type="text" name="member.name" id="name"
                                               class="form-control" placeholder="请输入会员名称" value="${member.name!}">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-3 control-label" for="card_no">会员卡号 <span class="required">*</span></label>

                                <div class="col-md-9">
                                    <div class="input-icon right">
                                        <i class="fa"></i>
                                        <input type="text" name="member.card_no" id="card_no"
                                               class="form-control" placeholder="请输入会员卡号" value="${member.card_no!}">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-3 control-label" for="nationality">国籍 <span class="required">*</span></label>

                                <div class="col-md-9">
                                    <select class="form-control select2me" id="nationality" data-placeholder="请选择国籍" name="member.nationality">
                                        <option value="中国">中国</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-3 control-label" for="gender-0">性别 <span class="required">*</span></label>

                                <div class="col-md-9">
                                    <div class="radio-list">
                                        <#if member??>
                                            <label class="radio-inline">
                                                <input type="radio" name="member.gender" id="gender-0" value="0" checked> 女 </label>
                                            <label class="radio-inline">
                                                <input type="radio" name="member.gender" id="gender-1" value="1"> 男 </label>
                                        <#else>

                                            <label class="radio-inline">
                                                <input type="radio" name="member.gender" id="gender-0" value="0" <#if !member.gender>checked</#if> > 女
                                            </label>
                                            <label class="radio-inline">
                                                <input type="radio" name="member.gender" id="gender-1" value="1" <#if member.gender>checked</#if> > 男
                                            </label>
                                        </#if>

                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-3 control-label" for="id_card">身份证号 <span class="required">*</span></label>

                                <div class="col-md-9">
                                    <div class="input-icon">
                                        <i class="fa fa-credit-card"></i>
                                        <input type="text" class="form-control" name="member.id_card" id="id_card" value="${member.id_card!}"
                                               placeholder="请输入会员的身份证号">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-3 control-label" for="phone">手机号码 <span class="required">*</span></label>

                                <div class="col-md-9">
                                    <div class="input-icon">
                                        <i class="fa fa-mobile"></i>
                                        <input type="text" class="form-control" id="phone" name="member.phone" value="${member.phone!}"
                                               placeholder="请输入会员的手机号码">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-3 control-label" for="postcode">邮编 <span class="required">*</span></label>

                                <div class="col-md-9">
                                    <div class="input-icon">
                                        <i class="fa fa-archive"></i>
                                        <input type="text" class="form-control" name="member.postcode" id="postcode" value="${member.postcode!}"
                                               placeholder="请输入会员的邮编">
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-3 control-label" for="mail_address">邮寄地址 <span class="required">*</span></label>

                                <div class="col-md-9">
                                    <textarea id="mail_address" cols="8" name="member.mail_address" class="form-control" rows="3"
                                              placeholder="请输入会员的邮寄地址">${member.mail_address!}</textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-3 control-label" for="birth">生日</label>

                                <div class="col-md-9">
                                    <div class="input-group input-medium date date-picker" data-date-format="yyyy-mm-dd">
                                        <input type="text" class="form-control" id="birth" name="member.birth"
                                               <#if member.birth??>value="${member.birth?string("yyyy-mm-dd")}"</#if> readonly>
                                    <span class="input-group-btn">
                                        <button class="btn default" type="button"><i class="fa fa-calendar"></i></button>
                                    </span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-3 control-label" for="email">邮箱</label>

                                <div class="col-md-9">
                                    <div class="input-icon">
                                        <i class="fa fa-envelope"></i>
                                        <input type="email" class="form-control" name="member.email" id="email" value="${member.email!}"
                                               placeholder="请输入会员的邮箱">
                                    </div>
                                </div>
                            </div>

                        </div>
                        <div class="form-actions right">
                            <button type="submit" class="btn green">保存</button>
                            <a href="${ctx}/customer/member" class="btn default">取消</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <script id="message-template" type="text/x-handlers-template">
        <div class="alert {{class}} fade in widget-inner" id="alert">
            <button type="button" class="close" data-dismiss="alert">×</button>
            {{message}}
        </div>
    </script>
    </@override>


    <@override name="viewmodule">member_item</@override>
    <@extends name="../_basic/service.ftl"></@extends>
</#compress>